<?php
if(is_plugin_page()) {
    load_plugin_textdomain('hidepost', 'wp-content/plugins/hidepost');
    $location = get_option('siteurl') . '/wp-admin/admin.php?page=hidepost/options.php';
	
//Update Option
if ('process' == $_POST['stage']) {
        update_option('hidepost_text', $_POST['hidepost_text']);
        update_option('open_tag', $_POST['open_tag']);
        update_option('close_tag', $_POST['close_tag']);
    }


//Load the config
include("option_init.php");

//Main Option Page
?>
<form name="update_hidepost" method="post" action="<?php echo $location ?>&amp;updated=true">
<input type="hidden" name="stage" value="process" /> 
	<div class="wrap">
		<h2>HidePost Options</h2>
		<p>	
			<label><strong>Show text:  </strong></label>
			<input name="hidepost_text" type="text" id="hidepost_text" value="<?php echo $hidepost_text; ?>" size="100" />
		</p>
		<p><strong>Note: </strong></p>
		<p>%login% = Link to you Login page.</p>
		<p>		 %register% = Link to you Register page.</p>
		<p>		 You can use any HTML code in the ShowText.</p>
		<p>
			<label><strong>Open Tag:  </strong></label>
			<input name="open_tag" type="text" id="open_tag" value="<?php echo $open_tag; ?>" size="12" />
			<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span>
			<label><strong>Close Tag:  </strong></label>
			<input name="close_tag" type="text" id="close_tag" value="<?php echo $close_tag; ?>" size="13" />
		</p>
		<p class="submit">
            <input type="submit" name="Submit" value="Save Options  &raquo;" />
        </p>
	</div>
</form>
<?php
}
?>
